﻿@namespace BlazorFluentUI
@inherits FluentUIComponentBase

<div class=@($"mediumFont ms-Dialog-content{(DialogType == DialogType.LargeHeader ? " ms-Dialog--lgHeader":"")}{(DialogType == DialogType.Close ? " ms-Dialog--close":"")}{(IsMultiline ? " ms-Dialog--multiline":"")} {this.ClassName}")>
    <div class="ms-Dialog-header" style=@(string.IsNullOrWhiteSpace(DraggableHeaderClassName) ? "" : "cursor: move;")>
        <p class="xlargeFont ms-Dialog-title" id=@TitleId role="heading" aria-level=2>
            @Title
        </p>
        <div class="ms-Dialog-topButton">
            @*@for (var i = 0; i < TopButtons.Count; i++)
                {
                    <IconButton key={props.uniqueId || index}/>
                }*@

            @if (DialogType == DialogType.Close || (ShowCloseButton && DialogType != DialogType.LargeHeader))
            {
                /* This is causing problems when we try to dismiss the window while this is in animation. */
                <TooltipHost>
                    <ChildContent>
                        <IconButton ClassName="ms-Dialog-button"
                                    IconName="dismiss"
                                    AriaLabel=@CloseButtonAriaLabel
                                    OnClick=@(ev => OnDismiss.InvokeAsync(ev)) />
                    </ChildContent>
                    <TooltipContent>
                        @CloseButtonAriaLabel
                    </TooltipContent>
                </TooltipHost>

            }
        </div>
    </div>
    <div class="ms-Dialog-inner">
        <div class="ms-Dialog-innerContent">
            @if (!string.IsNullOrWhiteSpace(SubText))
            {
                <p class="mediumFont ms-Dialog-subText" id=@SubTextId>
                    @SubText
                </p>
            }
            @if (ContentTemplate != null)
            {
                @ContentTemplate
            }
        </div>
        <div class="ms-Dialog-actions">
            <div class="ms-Dialog-actionsRight">
                @if (FooterTemplate != null)
                {
                    @FooterTemplate
                }
            </div>
        </div>
    </div>
</div>